<template>
    <div id="app">
        <div id="nav">
            <router-view :key="key" />
        </div>
        <div class="backtop" v-if="visible" @click="backToTop">
            <img src="@/assets/pageUp.webp" class="img" alt="backtop" />
        </div>
        <!-- <HelloWorld msg="Welcome to Your Vue.js App" /> -->
    </div>
</template>

<script>
// import HelloWorld from './components/HelloWorld.vue'

export default {
    components: {
        // HelloWorld,
    },
    data() {
        return {
            visible: false,
        };
    },
    computed: {
        router() {
            return this.$route;
        },
        key() {
            return this.$route.name !== undefined
                ? this.$route.name + +new Date()
                : this.$route + +new Date();
        },
    },
    methods: {
        backToTop() {
            let currentPos = window.pageYOffset;
            let interval = setInterval(function () {
                if (currentPos > 0) {
                    currentPos -= Math.max(1, Math.floor(currentPos / 10));
                    window.scrollTo(0, currentPos);
                } else {
                    clearInterval(interval);
                }
            }, 10);
        },
        checkPosition() {
            this.visible = window.scrollY > 800;
        },
    },
    mounted() {
        window.addEventListener("scroll", this.checkPosition);
    },
    beforeDestroy() {
        window.removeEventListener("scroll", this.checkPosition);
    },
}
</script>

<style lang="scss">
.Reverse {
    direction: rtl;
}

.contarner-page {
    background-color: #02051F !important;
}

.my-custom-confirm {
    background-color: #222C44 !important;
    border-color: #344264;
    border-radius: 14px;
}

.my-custom-confirm .el-message-box__message {
    color: #eee !important;
    /* 修改文字颜色 */
}

.my-custom-confirm .el-message-box__title {
    color: #eee !important;
    /* 修改标题颜色 */
}

.cancelButtonClass {
    background: #344264;
    border: 0;
    color: #eee;
}

.confirmButtonClass {
    border: 0;
    background: linear-gradient(270deg, #074CFF 0%, #01C2FF 100%) !important;
    color: #eee;
}

input {
    border: none;
    outline: none;
    background: none;
    padding: 0;
    margin: 0;
    appearance: none;
    /* 移除样式差异性，比如伪元素 */
    -webkit-appearance: none;
    /* 给 Safari 使用 */
    -moz-appearance: none;
    /* 给 Firefox 使用 */
}

.backtop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 42px;
    height: 42px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .backtop {
        width: 36px !important;
        height: 36px !important;
    }

    .my-custom-confirm {
        /* 确保使用相对的定位 */
        position: absolute;
        /* 居中弹框 */
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 86%;
        font-size: 16px;
    }

    .el-message-box__title {
        font-size: 16px;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* list-style: disc; */
}

#app {
    font-family: Arial, Arial;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #333;
}

.contarner-page {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
}

.img {
    width: 100%;
    height: 100%;
    /* justify-content: spa; */
}

.flex_ {
    display: flex;
    align-items: center;
}

.flex_between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex_center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.shou {
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.flex_ccenter {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.flex_around {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.flex_around_ {
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.flex_column {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.container {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container {}
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
        padding: 0 14px;
    }

}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1040px;
    }
}

.f-42 {
    font-size: 42px;
}

.f-36 {
    font-size: 36px;
}

.f-32 {
    font-size: 32px;
}

.f-22 {
    font-size: 22px;
}

.f-24 {
    font-size: 24px;
}

.f-21 {
    font-size: 21px;
}

.f-18 {
    font-size: 18px;
}

.f-16 {
    font-size: 16px;
}

.f-14 {
    font-size: 14px;
}

.fw700 {
    font-weight: 700;
}

.fw400 {
    font-weight: 400;
}

.italic {
    font-style: italic;
}

.c-000 {
    color: #1D212C;
}

.c-fff {
    color: #ffffff;
}

.c-ccc {
    color: rgba(29, 33, 44, .5);
}

.c-blue {
    color: #3129DD;
}

a {
    /* 去除下划线 */
    text-decoration: none;

    /* 去除颜色变化 */
    color: inherit;
    /* 让链接颜色继承父元素的颜色 */

    /* 去除点击时的轮廓 */
    outline: none;
}


.disabled {
    cursor: no-drop;
}


@font-face {
    font-family: 'Arial';
    src: url('@/assets/fonts/arial.ttf') format('truetype'),
        url('@/assets/fonts/arialbd.ttf') format('truetype'),
        url('@/assets/fonts/arialbi.ttf') format('truetype');
    font-style: normal;
}

@font-face {
    font-family: 'Arial-Bold';
    src: url('@/assets/fonts/arialbd.ttf') format('truetype'),
        url('@/assets/fonts/arial.ttf') format('truetype');
    font-style: normal;
}

@font-face {
    font-family: 'Arial-Regular';
    src: url('@/assets/fonts/arial.ttf') format('truetype');
    font-style: normal;
}

@font-face {
    font-family: 'Arial-Bold Italic';
    src: url('@/assets/fonts/arialbd.ttf') format('truetype'),
        url('@/assets/fonts/arialbi.ttf') format('truetype');
    font-style: normal;
}



/* 隐藏滚动条 */
::-webkit-scrollbar {
    width: 0.5em;
    background-color: transparent;
}

::-webkit-scrollbar-track {
    background-color: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #5d636b;
    border-radius: 0.5em;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

::-webkit-scrollbar {
    width: 6px;
    height: 8px;
    background-color: transparent;
}

::-webkit-scrollbar-thumb {
    box-shadow: inset 0 0 6px #5d636b;
    -webkit-box-shadow: inset 0 0 6px #5d636b;
    background-color: #ccc;
}

::-webkit-scrollbar-track {
    box-shadow: inset 0 0 5px transparent;
    border-radius: 3px;
    background: transparent;
}
</style>